package cn.fjc920.siaa.activityutils

import android.content.Context
import androidx.appcompat.app.AppCompatDelegate
import cn.fjc920.siaa.R

class ThemeProvider(private val context: Context) {

    fun getDescriptionForTheme(selectedTheme: String?): String {
        return when (selectedTheme) {
            "light" -> context.getString(R.string.settings_theme_value_light)
            "night" -> context.getString(R.string.settings_theme_value_dark)
            else -> context.getString(R.string.settings_theme_value_default)
        }
    }

    fun getTheme(selectedTheme: String?): Int {
        return when (selectedTheme) {
            "light" -> AppCompatDelegate.MODE_NIGHT_NO
            "dark" -> AppCompatDelegate.MODE_NIGHT_YES
            else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
        }
    }
}